﻿module poseidon.loader;


private import dwt.all;
private import poseidon.controller.gui;
private import poseidon.globals;
private import poseidon.controller.dialog.splash;


class Loader {

	private Display display;
	private Shell	shell;
	
	/** Load GUI and display a Splashscreen while loading */
	private this(){

		/** Apply application name to Display */
		Display.setAppName("Poseidon");
	
		/** Create a new Display */
		display = Display.getDefault();
		shell = new Shell(display);

		// show splash screen if desired
		Shell splash;
		if(Globals.showSplash){
			splash = new Splash(shell);
		}

		Globals.initI18N();
		Globals.loadI18N(Globals.curLang);

		
		/** Load the application */
		(new GUI(display, shell, splash)).showGui();
	}

	private static void startupProcess(char[][] args)
	{
		// the first call
		Globals.firstCall();
	}

	public static void main(char[][] args){

		startupProcess(args);
		
		/** Start loading of Maincontroller */
		new Loader();
	}
}
